#ifndef CUSTOMPANEL_H
#define CUSTOMPANEL_H

#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QMenu>
#include <QEvent>
#include <QMouseEvent>

class CustomPanel : public QWidget
{
    Q_OBJECT

public:
    CustomPanel(QWidget *parent = nullptr);
    ~CustomPanel();
    QSize sizeHint()        const;
    QSize minimumSizeHint() const;

protected:
    bool eventFilter(QObject *watched, QEvent *event);

private:
    void initControl();
    void initForm();
    void initMenu();

    void hide_client_all();
    void change_client(int index, int flag);
    void change_client_4(int index);
    void change_client_16(int index);

private slots:
    void full();
    void poll();
    void snapshot_client_one();
    void snapshot_client_all();

    void show_client_all();
    void show_client_4();
    void show_client_16();


signals:
    void fullScreen(bool full);

private:
    QGridLayout *gridLayout;
    bool clientMax;
    int clientCount;
    QString clientType;         //当前画面类型
    QMenu *clientMenu;
    QAction *actionFull;        //全屏动作
    QAction *actionPoll;        //轮徇动作
    QList<QLabel *> clientWidget;

};
#endif // CUSTOMPANEL_H
